package com.qf.agro.web.controller.device;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.agro.common.sys.ResultInfo;
import com.qf.agro.pojo.device.SmartDeviceLog;
import com.qf.agro.service.device.SmartDeviceLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/device/deviceLog")
public class SmartDeviceLogController {
    @Autowired
    private SmartDeviceLogService smartDeviceLogService;
    @GetMapping("/page")
    public ResultInfo findPage(@RequestParam(value = "page",defaultValue = "1") Integer pageNum,
                               @RequestParam(defaultValue = "5") Integer pageSize,
                               Long facilitiesId, String name){
        Page<SmartDeviceLog> page = smartDeviceLogService.fidnPage(pageNum, pageSize, facilitiesId, name);
        return ResultInfo.success(page);
    }
}
